package com.migration.model.newdb;

import jakarta.persistence.*;
import lombok.Data;
import java.io.Serializable;

/**
 * 事故链-影响节点 实体类
 * 表名：risk_chain_effect
 * 自动生成的实体类
 */
@Data
@Entity
@Table(name = "risk_chain_effect")
public class RiskChainEffect implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /**
     * 
     * 主键
     */
    @Id
    @Column(name = "id", nullable = false)
    private Long id;
    
    /**
     * 影响节点ID
     */
    @Column(name = "effect_id", nullable = false, length = 50)
    private String effectId;
    
    /**
     * 租户ID
     */
    @Column(name = "tenant_id", nullable = false)
    private Long tenantId;
    
    /**
     * 部门ID
     */
    @Column(name = "department_id", nullable = false)
    private Long departmentId;
    
    /**
     * 分析类型1：连续工艺，2：间隙工艺，3：JSA操作
     */
    @Column(name = "analysis_type", nullable = false)
    private Integer analysisType;
    
    /**
     * 根据分析类型指向设备-偏离、设备-步骤、设备-操作表ID
     */
    @Column(name = "analysis_id", nullable = false)
    private Long analysisId;
    
    /**
     * 事故链-原因表ID
     */
    @Column(name = "cause_id", nullable = false, length = 50)
    private String causeId;
    
    /**
     * 上级节点ID 0标识头节点
     */
    @Column(name = "parent_effect_id", nullable = false, length = 50)
    private String parentEffectId;
    
    /**
     * 来源影响节点ID，相同的组链时被认为是同一个节点
     */
    @Column(name = "from_effect_id", nullable = false, length = 50)
    private String fromEffectId;
    
    /**
     * 当前节点是链上第几个节点
     * 默认值: 0
     */
    @Column(name = "serial_num")
    private Integer serialNum;
    
    /**
     * 设备ID
     */
    @Column(name = "device_id", nullable = false)
    private Long deviceId;
    
    /**
     * 影响描述
     */
    @Column(name = "effect_desc", nullable = false, length = 100)
    private String effectDesc;
    
    /**
     * 备注
     */
    @Column(name = "node_remark", length = 255)
    private String nodeRemark;
    
    /**
     * 创建时间
     */
    @Column(name = "create_time", length = 20)
    private String createTime;
    
    /**
     * 更新时间
     */
    @Column(name = "update_time", length = 20)
    private String updateTime;
    
    /**
     * 创建人
     */
    @Column(name = "create_by")
    private Long createBy;
    
    /**
     * 更新人
     */
    @Column(name = "update_by")
    private Long updateBy;
    
    /**
     * 逻辑删除标志（0：正常，1：删除）
     * 默认值: 0
     */
    @Column(name = "is_del")
    private Boolean isDel;
    
    @Override
    public String toString() {
        return "RiskChainEffect{" +
            "id=" + id +
            ", effectId=" + effectId +
            ", tenantId=" + tenantId +
            ", departmentId=" + departmentId +
            ", analysisType=" + analysisType +
            ", analysisId=" + analysisId +
            ", causeId=" + causeId +
            ", parentEffectId=" + parentEffectId +
            ", fromEffectId=" + fromEffectId +
            ", serialNum=" + serialNum +
            ", deviceId=" + deviceId +
            ", effectDesc=" + effectDesc +
            ", nodeRemark=" + nodeRemark +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            ", createBy=" + createBy +
            ", updateBy=" + updateBy +
            ", isDel=" + isDel +
        '}';
    }
} 